package com.ruoyi.system.service.impl;

import java.util.List;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BizCommunityMapper;
import com.ruoyi.system.domain.BizCommunity;
import com.ruoyi.system.service.IBizCommunityService;

/**
 * 小区Service业务层处理
 *
 * @author ruoyi
 * @date 2023-01-25
 */
@Service
public class BizCommunityServiceImpl implements IBizCommunityService
{
    @Autowired
    private BizCommunityMapper bizCommunityMapper;

    /**
     * 查询小区
     *
     * @param id 小区主键
     * @return 小区
     */
    @Override
    public BizCommunity selectBizCommunityById(String id)
    {
        return bizCommunityMapper.selectBizCommunityById(id);
    }

    /**
     * 查询小区列表
     *
     * @param bizCommunity 小区
     * @return 小区
     */
    @Override
    public List<BizCommunity> selectBizCommunityList(BizCommunity bizCommunity)
    {
        return bizCommunityMapper.selectBizCommunityList(bizCommunity);
    }

    /**
     * 新增小区
     *
     * @param bizCommunity 小区
     * @return 结果
     */
    @Override
    public int insertBizCommunity(BizCommunity bizCommunity)
    {
        String id = IdUtil.getSnowflakeNextIdStr();
        bizCommunity.setId(id);
        return bizCommunityMapper.insertBizCommunity(bizCommunity);
    }

    /**
     * 修改小区
     *
     * @param bizCommunity 小区
     * @return 结果
     */
    @Override
    public int updateBizCommunity(BizCommunity bizCommunity)
    {
        return bizCommunityMapper.updateBizCommunity(bizCommunity);
    }

    /**
     * 批量删除小区
     *
     * @param ids 需要删除的小区主键
     * @return 结果
     */
    @Override
    public int deleteBizCommunityByIds(String[] ids)
    {
        return bizCommunityMapper.deleteBizCommunityByIds(ids);
    }

    /**
     * 删除小区信息
     *
     * @param id 小区主键
     * @return 结果
     */
    @Override
    public int deleteBizCommunityById(String id)
    {
        return bizCommunityMapper.deleteBizCommunityById(id);
    }
}
